aboutsummaryrefslogtreecommitdiff
path: root/src/app/manga/[title]/[id]/[read]/currentReading.jsx
diff options
context:
space:
mode:
authorreal-zephex <[email protected]>2024-03-29 14:38:23 +0530
committerreal-zephex <[email protected]>2024-03-29 14:38:23 +0530
commitd9a9535ea8f38a1d63a7accd77e7175d5b822284 (patch)
tree02680d7deb0f1b811fd00c42df86eabc24aee31d /src/app/manga/[title]/[id]/[read]/currentReading.jsx
parentUpdate README.md (diff)
downloaddramalama-d9a9535ea8f38a1d63a7accd77e7175d5b822284.tar.xz
dramalama-d9a9535ea8f38a1d63a7accd77e7175d5b822284.zip
fix: manga page now indicates what chapter you are reading
Diffstat (limited to 'src/app/manga/[title]/[id]/[read]/currentReading.jsx')
-rw-r--r--src/app/manga/[title]/[id]/[read]/currentReading.jsx27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/app/manga/[title]/[id]/[read]/currentReading.jsx b/src/app/manga/[title]/[id]/[read]/currentReading.jsx
new file mode 100644
index 0000000..c368f75
--- /dev/null
+++ b/src/app/manga/[title]/[id]/[read]/currentReading.jsx
@@ -0,0 +1,27 @@
+"use client";
+import { useState, useEffect } from "react";
+import styles from "./read.module.css";
+
+export default function CurrentReading() {
+ const [chapter, setChapter] = useState(null);
+ const [volume, setVolume] = useState(null);
+
+ useEffect(() => {
+ setChapter(localStorage.getItem("chapter") || "");
+ setVolume(localStorage.getItem("volume") || "");
+ });
+
+ return CR(chapter, volume);
+}
+
+function CR(chapter, volume) {
+ return (
+ <div className={styles.CurrentReadingContainer}>
+ {chapter && volume && (
+ <p>
+ Vol {volume} Chapter {chapter}
+ </p>
+ )}
+ </div>
+ );
+}